import { request } from "@/utils/service"
import { getToken } from "@/utils/cache/cookies"

/** 店铺订单获取code */
export function getcaptureApi(params: any) {
  return request<any>({
    url: "/capture/pdd/login",
    method: "get",
    params
  })
}

/** 店铺订单2.0获取code */
export function getcaptureNewApi(params: any) {
  return request<any>({
    url: "/capture/pddNew/login",
    method: "get",
    params
  })
}

/** 店铺订单查 */
export function getOrderListApi(params: any) {
  return request<any>({
    url: "/capture/pdd/getOrderList",
    method: "get",
    params
  })
}
/** 店铺订单2.0查 */
export function getOrderListNewApi(params: any) {
  return request<any>({
    url: "/capture/pddNew/getOrderList",
    method: "get",
    params
  })
}

//查看详情 解密

export function getcaptureInfo(data: any) {
  return request<any>({
    url: "/capture/pdd/batchDecrypt",
    method: "post",
    headers: {
      "Content-Type": "multipart/form-data",
      token: getToken()
    },
    data
  })
}

// 查询身份证信息
/** 店铺订单查 */
export function getCidInfoApi(data: any) {
  return request<any>({
    url: "/capture/pddNew/getInformation",
    method: "post",
    headers: {
      "Content-Type": "multipart/form-data",
      token: getToken()
    },
    data
  })
}

//提交订单
export function pushPddOrder(data: any, index: any) {
  return request<any>({
    url: `/capture/pdd/submit?index=${index}`,
    method: "post",
    data
  })
}
//提交订单2.0
export function pushPddNewOrder(data: any, index: any) {
  return request<any>({
    url: `/capture/pddNew/submit?index=${index}`,
    method: "post",
    data
  })
}

//根据订单号查询订单详情
export function getOrderInfo(data: any) {
  return request<any>({
    url: "/capture/pddNew/getOrder",
    method: "post",
    headers: {
      "Content-Type": "multipart/form-data",
      token: getToken()
    },
    data
  })
}

//店铺绑定
//新增

export function buildShop(data: any) {
  return request<any>({
    url: "order/pddShop/add",
    method: "post",
    data
  })
}
//查看
export function getShopList(params: any) {
  return request<any>({
    url: "order/pddShop/query",
    method: "get",
    params
  })
}
//删除

export function deleteShop(id: string) {
  return request({
    url: "order/pddShop/del",
    method: "delete",
    params: {
      id
    }
  })
}
//修改

export function updateShopApi(data: any) {
  return request({
    url: "order/pddShop/update",
    method: "put",
    data
  })
}

//根据账号id查询团队店铺配置

export function getShopInfo(params: any) {
  return request({
    url: "/order/pddShop/queryOne",
    method: "GET",
    params
  })
}
